package com.atguigu.serviceoss.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * ClassName: OSSProperties
 * Package: com.atguigu.serviceoss.properties
 * Description:
 *
 * @Author 刘强
 * @Create 2024/4/20 8:44
 * @Version 1.0
 */
@Configuration
@ConfigurationProperties(prefix = "aliyun.oss")
@Data
public class OSSProperties {
    private String endpoint;
    private String bucketName;
    private String accessKeyId;
    private String secretAccessKey;
    private String domainName;

    public static String END_POINT;
    public static String BUCKET_NAME;
    public static String ACCESS_KEY_ID;
    public static String SECRET_ACCESS_KEY;
    public static String DOMAIN_NAME;
    @PostConstruct
    public void init(){
        END_POINT = endpoint;
        BUCKET_NAME = bucketName;
        ACCESS_KEY_ID = accessKeyId;
        SECRET_ACCESS_KEY = secretAccessKey;
        DOMAIN_NAME = domainName;
    }
}
